import java.util.*;

/**
 * 
 * @author Pietro Bua & Rohmin Mirza
 *
 */
public class Data
{
	private ArrayList<Integer> myPositionsInText = new ArrayList<Integer>();
	private int myValue;
	
	/**
	 * 
	 * @param postionInText
	 */
	public Data( int value )
	{
		myValue = value;
	}
	
	/**
	 * 
	 * @param pos
	 */
	public void addPos()
	{
		myPositionsInText.add(myValue);
	}
	
	/**
	 * 
	 * @return
	 */
	public ArrayList<Integer> getPositions()
	{
		return myPositionsInText;
	}
	
	/**
	 * 
	 * @param positions
	 */
	public void addPositions( ArrayList<Integer> positions )
	{
		myPositionsInText.addAll( positions );
	}
	
	/**
	 * 
	 * @param pos
	 */
	public void removePos( int pos )
	{
		for(int i=0;i<myPositionsInText.size();i++)
		{
			if(myPositionsInText.get(i) == pos )
			{
				myPositionsInText.remove(i);
			}
		}
	}

	/**
	 * 
	 */
	public void removeOne()
	{
		myPositionsInText.remove(0);
	}
	
	/**
	 * 
	 * @return
	 */
	public int getPositionsCount()
	{
		
		return myPositionsInText.size();
	}
	
	/**
	 * 
	 * @return
	 */
	public int getValue()
	{
		return myValue;
	}
	
	/**
	 * 
	 * @param value
	 */
	public void setValue( int value )
	{
		myValue = value;
	}
	
	/**
	 * 
	 */
	public String toString()
	{
		String ret = "";
		for(Integer n:myPositionsInText)
		{
			 ret += n.toString() + " ";
		}
		return "Data:_Size:_[" + myPositionsInText.size() + "]_Position(s):_[" + ret + "]"; 
	}
}
